package tech.aistar.corejava.day04;

import java.util.Arrays;

/**
 * Created by 李雨昂 on 2019/7/18.
 */
public class EqualsArray {
    public static void main(String[] args) {
        int[] arr1 = {1,2,3};
        int[] arr2 = {1,2,3};
        System.out.println(arr1 == arr2);//false
        System.out.println(arr1.equals(arr2));//false

        //存放的数据的顺序和值一致,就希望返回true
        System.out.println(Arrays.equals(arr1,arr2));//true
        System.out.println("======================");
        String str1 = new String("atguigu");
        String str2 = new String("atguigu");
        //final
        String str3 = "abc";
        String str4 = "abc";
        String str5 = "abc"+str3;
        String str6 = "abcabc";

        System.out.println(str1 == str2);//false
        System.out.println(str1.equals(str2));//true
        System.out.println("===================");
        System.out.println(str3 == str4);//true
        System.out.println(str3.equals(str4));//true
        System.out.println("===================");
        System.out.println(str5 == str6);//false
        System.out.println(str5.equals(str6));//true
        int a = 1;
        int b = 1;
        System.out.println(a == b);//true


    }
}
